package org.madbit.pingu;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class ConnectionDetails extends Activity {
	
	// Called when the activity is first created.
	@Override
	public void onCreate(Bundle savedInstanceState) {
	//Your code here
		super.onCreate(savedInstanceState);
        setContentView(R.layout.connection_details);
        String name = (String) this.getIntent().getSerializableExtra("key");
		
		TextView tv = (TextView) findViewById(R.id.connectionName);
		tv.setText(name);
	}
	
	public void onClick(View v) {
		//Toast.makeText(getBaseContext(), "Please enter Number.", Toast.LENGTH_LONG).show();
		showAddDialog();
      }
	
	private void showAddDialog() { 

		final String TAG = "test"; 
		final Dialog loginDialog = new Dialog(this); 
		loginDialog.getWindow().setFlags( 
				WindowManager.LayoutParams.FLAG_BLUR_BEHIND, 
				WindowManager.LayoutParams.FLAG_BLUR_BEHIND); 
		loginDialog.setTitle("Add Phone Number"); 

		LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
		View dialogView = li.inflate(R.layout.add_dailog, null); 
		loginDialog.setContentView(dialogView); 

		loginDialog.show(); 

		Button addButton = (Button) dialogView.findViewById(R.id.add_button); 
		Button cancelButton = (Button) dialogView.findViewById(R.id.cancel_button); 

		addButton.setOnClickListener(new OnClickListener() { 
			// @Override 
			public void onClick(View v) { 

				Toast.makeText(getBaseContext(), "Please enter Number.", Toast.LENGTH_LONG).show(); 
			}
		});
		
		cancelButton.setOnClickListener(new OnClickListener() { 
			// @Override 
			public void onClick(View v) { 
			loginDialog.dismiss(); 
			} 
			}); 
	}
}



